import http from '@/utils/request'

// 获取所有角色列表
export const reqGetRolesList = queryInfo => {
  return http({
    method: 'get',
    url: '/sys/role',
    params: queryInfo
  })
}

// 删除角色
export const reqDelRoles = id => {
  return http({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}

// 新增
export const reqAddRole = data => {
  return http({
    method: 'post',
    url: '/sys/role',
    data
  })
}

// 根据id获取角色详情 回显
export const reqRoleId = id => {
  return http({
    method: 'get',
    url: `/sys/role/${id}`
  })
}

// 根据id编辑角色
export const reqUpdateRole = data => {
  return http({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}

// 根据id查询企业
export const reqCompanyById = id => {
  return http({
    method: 'get',
    url: `/company/${id}`
  })
}
